# Maintainer: ImperatorS79 <fevrier.simon@gmail.com>

_realname=amf-headers
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=1.4.23
pkgrel=2
pkgdesc='Header files for AMD Advanced Media Framework'
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32')
url='https://github.com/GPUOpen-LibrariesAndSDKs/AMF/'
license=('MIT')
source=("${_realname}-${pkgver}.tar.gz::https://github.com/GPUOpen-LibrariesAndSDKs/AMF/archive/v${pkgver}.tar.gz"
        "0001-prevent-some-redefinition.patch")
sha256sums=('7c8a5c91bca54e257258e4efcc61925921f2efe432efd34cf77dd9dc1803c38a'
            'cb81680806a7049bff2b1ac70d46fe925fc91e5ab763db30f7f4f4a8b89daebc')

prepare() {
  cd "AMF-${pkgver}"

  # https://github.com/GPUOpen-LibrariesAndSDKs/AMF/pull/286
  patch -p1 -i "${srcdir}/0001-prevent-some-redefinition.patch"
}

package() {
    mkdir -p "${pkgdir}${MINGW_PREFIX}"/include/AMF/
    cp -r "${srcdir}/AMF-${pkgver}"/amf/public/include/core/ "${pkgdir}${MINGW_PREFIX}"/include/AMF/
    cp -r "${srcdir}/AMF-${pkgver}"/amf/public/include/components/ "${pkgdir}${MINGW_PREFIX}"/include/AMF/

    install -D -m644 "${srcdir}/AMF-${pkgver}"/LICENSE.txt "${pkgdir}${MINGW_PREFIX}"/share/licenses/${_realname}/LICENSE
}
